<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    <title>导出查询结果页面</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<link href="css/moban.css" type="text/css" rel="stylesheet" media="screen" />
    <link href="css/widget.css" type="text/css" rel="stylesheet" media="screen" />  
    <link href="./managementOfMember/css/btn.css" type="text/css" rel="stylesheet" media="screen" />
    <script type="text/javascript" src="./managementOfMember/js/select.js"></script>
     <script type="text/javascript" src="./managementOfMember/js/jquery-1.8.3.min.js"></script>

    <style type="text/css">
    table{
  	border-collapse:collapse;	
	width:80%;
	margin:20px auto;
 	}
 	tr td{
	border:2px solid #2E5E79;
	line-height:25px;
	text-align:left;
	padding-left:10px;
	}
	input{
	border:2px solid black;
	}
    ul li{
    	width:20%;
    	margin-right:10px;
    }
    </style>
    <script type="text/javascript">
    function ss(){
	    	var slt=document.getElementById("searchName");
	    	var slt2 = document.getElementById("searchValue1");
    		var slt3 = document.getElementById("searchValue2");
    		var slt4 = document.getElementById("fileName");
	    	if(slt.value==""){
	    	alert("请选择导出记录");
	    	return false;
	    	}else if(slt.value=="department" || slt.value=="process"){    		    			
	    			if(slt2.value==""){
	    				alert("请选择相应内容");
	    				return false;
	    			}else{
	    				return true;
	    			}	
	    	}else if(slt.value=="major"){	    		
	    		if(slt2.value==""||slt3.value==""){
	    			alert("请选择相应内容");
	    			return false;
	    		}else{
    				return true;
    			}	    			    	
	    	}else if(slt4.value==""){
	    		alert("请填写导出的文件名");
	    		return false;
	    	}else{
	    		return true;
	    	}
    	}
    function showMsg() {
    	var msg = '${message}';
    	if(msg!=null&&msg!=""){
    		alert(msg);
    	}
    }
    </script>
</head>
<body onload="showMsg()">
  	<div style="background-color:#2E5E79;width:100%;height:50px;position:fixed;top:0;left:0;"></div>
<div id="package">
	<div id="hel">
		<div id="title">
    		<span><img src="./managementOfMember/images/home.png" /> &nbsp;导出信息选择</span>
    	</div>
    </div>
	<div id="content">
		<form  method="post" onsubmit="return ss()" action="excuteExportExcel.action">
			<table>
				<tr style="height:40px;">
					<td>选择导出记录：</td>				
				</tr>
				<tr style="height:40px;background-color:#408c99;">
					
					<td id="selectList">
		  	 			<select id="searchName" name="searchName" onchange="showSelect(this.value)">
		  	 			    <option value="">请选择</option>
		  	 			    <option value="全校">全校</option>
		  	 			    <option value="process">选择阶段</option>
		  	 			    <option value="department">选择团总支</option>  
		  	 			    <option value="major">选择团支部</option>  
						</select>&nbsp;&nbsp;&nbsp;
					</td>
				</tr>
								
				<tr style="height:40px;">
					<td>选择导出字段：</td>
				
				</tr>
					<tr style="border-top:1px solid #e3e3e3;">
					  	<td><input type="checkbox" onclick="SelectAll(0)" id="CheckAll"/>&nbsp;全选</td>
					
					</tr>
					<tr style="height:40px;background-color:#408c99;color:white;">
						<td><input type="checkbox" onclick="SelectAll(1)" id="CheckAll1"/><s:property value="#session.stages.get(1).name"/></td>						
					</tr>
					<tr >					 
					 	<td>
						  	<ul>
						  		<s:iterator value="#session.fields" var="field">
							  		<s:if test="#field.stage == 1">
										<li>
											<input type="checkbox" name="stage1" value=<s:property value="#field.name" /> />
											<s:property value="#field.chinese"/>
										</li>
									</s:if>
								</s:iterator> 
						  	</ul>
						</td>
					</tr>
					<tr style="height:40px;background-color:#408c99;color:white;">
						<td><input type="checkbox" onclick="SelectAll(2)" id="CheckAll2"/><s:property value="#session.stages.get(2).name"/></td>						
					</tr>
					<tr >					 
					  	<td>
						  	<ul>
						  		<s:iterator value="#session.fields" var="field">
							  		<s:if test="#field.stage == 2">
										<li>
											<input type="checkbox" name="stage2" value=<s:property value="#field.name" /> />
											<s:property value="#field.chinese"/>
										</li>
									</s:if>
								</s:iterator> 
						  	</ul>
						</td>
					</tr>
					<tr style="height:40px;background-color:#408c99;color:white;">
						<td><input type="checkbox" onclick="SelectAll(3)" id="CheckAll3"/><s:property value="#session.stages.get(3).name"/></td>						
					</tr>
					<tr >						
						<td>
						  	<ul>
						  		<s:iterator value="#session.fields" var="field">
							  		<s:if test="#field.stage == 3">
										<li>
											<input type="checkbox" name="stage3" value=<s:property value="#field.name" /> />
											<s:property value="#field.chinese"/>
										</li>
									</s:if>
								</s:iterator> 
						  	</ul>
						</td>
					</tr>
					<tr style="height:40px;background-color:#408c99;color:white;">
						<td><input type="checkbox" onclick="SelectAll(4)" id="CheckAll4"/><s:property value="#session.stages.get(4).name"/></td>						
					</tr>
					<tr >  	
					  	<td>
						  	<ul>
						  		<s:iterator value="#session.fields" var="field">
							  		<s:if test="#field.stage == 4">
										<li>
											<input type="checkbox" name="stage4" value=<s:property value="#field.name" /> />
											<s:property value="#field.chinese"/>
										</li>
									</s:if>
								</s:iterator> 
						  	</ul>
						</td>
					</tr>
					
				<tr style="height:40px;">
					<td>填写导出的文件名：<input type="text" name="fileName" id="fileName" class="in"/>&nbsp;&nbsp;&nbsp;<input type="submit" value="导出" class="className" /></td>
				</tr>
				
			</table>
		</form>
    </div>
</div>
<script type="text/javascript" src="./managementOfMember/js/menu.js"></script>
</body>
</html>
